.class public Lcom/brixd/niceapp/util/LocalFileUtil;
.super Ljava/lang/Object;
.source "LocalFileUtil.java"


# direct methods
.method public constructor <init>()V
    .registers 1

    .prologue
    .line 11
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static createTempImageFile(Landroid/content/Context;Ljava/io/File;)Ljava/io/File;
    .registers 8
    .param p0, "context"    # Landroid/content/Context;
    .param p1, "sourceFile"    # Ljava/io/File;

    .prologue
    .line 14
    invoke-static {}, Lcom/brixd/niceapp/application/NiceAppApplication;->getAppBaseDirName()Ljava/lang/String;

    move-result-object v0

    .line 15
    .local v0, "baseCacheLocation":Ljava/lang/String;
    new-instance v3, Ljava/io/File;

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    sget-object v5, Ljava/io/File;->separator:Ljava/lang/String;

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, "temp"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 16
    .local v3, "tempDir":Ljava/io/File;
    invoke-virtual {v3}, Ljava/io/File;->exists()Z

    move-result v4

    if-nez v4, :cond_2b

    .line 17
    invoke-virtual {v3}, Ljava/io/File;->mkdirs()Z

    .line 20
    :cond_2b
    const/4 v1, 0x0

    .line 22
    .local v1, "destFile":Ljava/io/File;
    :try_start_2c
    const-string v4, "img_"

    const-string v5, ".jpg"

    invoke-static {v4, v5, v3}, Ljava/io/File;->createTempFile(Ljava/lang/String;Ljava/lang/String;Ljava/io/File;)Ljava/io/File;

    move-result-object v1

    .line 23
    invoke-static {p1, v1}, Lcom/zuiapps/suite/utils/file/FileUtil;->copyFile(Ljava/io/File;Ljava/io/File;)Z
    :try_end_37
    .catch Ljava/lang/Exception; {:try_start_2c .. :try_end_37} :catch_38

    .line 28
    :goto_37
    return-object v1

    .line 24
    :catch_38
    move-exception v2

    .line 25
    .local v2, "e":Ljava/lang/Exception;
    invoke-virtual {v2}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_37
.end method
